<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>填写四则运算</title>
		<script type="text/javascript">
			
			function count(){
				var num1=prompt("请输入第一个数：","");
				var num2=prompt("请输入第二个数：","");
				var sign=prompt("请输入运算符号：","");
             if(sign=="+"){
             	var c=parseFloat(num1)+parseFloat(num2);
             	alert(num1+sign+num2+"="+c);
             }else if(sign=="-"){
             	var c=parseFloat(num1)-parseFloat(num2);
             	alert(num1+sign+num2+"="+c);
             	
             }else if(sign=="*"){
             	var c=parseFloat(num1)*parseFloat(num2);
             	alert(num1+sign+num2+"="+c);
             	
             }else if(sign=="/"){
             	var c=parseFloat(num1)/parseFloat(num2);
             	alert(num1+sign+num2+"="+c);
             }else if(sign=="%"){
             	var c=parseFloat(num1)%parseFloat(num2);
             	alert(num1+sign+num2+"="+c);
             }else{
             	alert("输入错误");
             }
             

			}
			
			
			
			
		</script>
		
	</head>
	<body>
		
		<input type="button" value="计算两数运算结果" onclick="count()" />
	</body>
</html>
